package de.rs.espresso.interfaces;

import java.util.List;

public interface ICover extends List<ICube>, Cloneable {

	/**
	 * Sorts the contained <code>ICube</code>s in decreasing size, so that largest <code>ICube</code>s can be processed first.
	 */
	public void sortByCubeWeight();
	
	
	/**
	 * Returns the supercube over the hole <code>ICover</code>.
	 * @return
	 */
	public ICube getSupercube();
	
	/**
	 * Clones the <code>ICover</code> <u><b>and</b></u> all its containing <code>ICube</code>s.
	 * @return
	 */
	public ICover clone();
	
	public boolean isVoid();
	
	public void removeVoidCubes();
	
	public int getMinDistance(ICube cube);

	public boolean isPartNeverSet(int value);

	public boolean neverRaisedAt(ICube cube, int value);
	
	public boolean intersect(ICube cube);

	public int countOccuringOfPart(int value);
	
	/**
	 * Checks if the <code>ICover</code> is a tautology with respect to the given <code>ICube</code>.
	 * @param cube
	 * @return
	 */
	public boolean isTautology(ICube cube);
	
	/**
	 * Determines whether the ICover is a tautology.
	 * @return
	 */
	public boolean isTautology();


	/**
	 * Returns the Cofactor of the entire <code>ICover</code>. with respect to the given <code>ICube</code>.
	 * @param cube
	 * @return
	 */
	ICover getCofactor(ICube cube);


	/**
	 * Returns the number of literals of the contained <code>ICube</code>s.
	 * @return
	 */
	public int getNumberOfLiterals();


	/**
	 * Returns a UpperBound for the Minterms in this {@link ICover}.
	 * @return
	 */
	public int getUpperBoundOfMinterms();
	
	/**
	 * Returns the most binate Literal in this {@code ICover}.
	 * @return
	 */
	public int getMostBinateLiteral();


	/**
	 * Returns the number of outputs of the contained <code>ICube</code>s.
	 * @return int
	 */
	public int getNumberOfOutputs();
	
	
	public List<ICover> getSingleOutputCovers();


	public boolean isUnate();
	
	
	/**
	 * Returns a List for each Leaf of the TAUTOLOGY-Check.
	 * Each List-Element contains another List with all {@link ICube ICubes} that are causing a TAUTOLOGY at this Leaf.
	 * @return
	 */
	public List<List<ICube>> getTautologyCubes();
	
	/**
	 * Selects a splitting variable, used in unate complementation algorithm.
	 * @return int
	 */
	public int unateComplementSelect();


	public void freezeCubes();


	public ICover getComplement();
	
	public ICover getComplement(ICover dcSet);


	/**
	 * Returns {@code true} if this ICover is more expensive than the given ICover, otherwise false.
	 * @param onSet
	 * @return
	 */
	public boolean compareCost(ICover onSet);


	public void draw(String title);



	
	
	
	
	
}
